var Drag = { obj : null, init : function(o, oRoot, minX, maxX, minY, maxY, bSwapHorzRef, bSwapVertRef, fXMapper, fYMapper) { o.onmousedown = Drag.start; o.hmode = bSwapHorzRef ? false : true ; o.vmode = bSwapVertRef ? false : true ; o.root = oRoot && oRoot != null ? oRoot : o ; if (o.hmode && isNaN(parseInt(o.root.style.left ))) o.root.style.left = "0px"; if (o.vmode && isNaN(parseInt(o.root.style.top ))) o.root.style.top = "0px"; if (!o.hmode && isNaN(parseInt(o.root.style.right ))) o.root.style.right = "0px"; if (!o.vmode && isNaN(parseInt(o.root.style.bottom))) o.root.style.bottom = "0px"; o.minX = typeof minX != 'undefined' ? minX : null; o.minY = typeof minY != 'undefined' ? minY : null; o.maxX = typeof maxX != 'undefined' ? maxX : null; o.maxY = typeof maxY != 'undefined' ? maxY : null; o.xMapper = fXMapper ? fXMapper : null; o.yMapper = fYMapper ? fYMapper : null; o.root.onDragStart = new Function(); o.root.onDragEnd = new Function(); o.root.onDrag = new Function(); }, start : function(e) { var o = Drag.obj = this; e = Drag.fixE(e); var y = parseInt(o.vmode ? o.root.style.top : o.root.style.bottom); var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right ); o.root.onDragStart(x, y); o.lastMouseX = e.clientX; o.lastMouseY = e.clientY; if (o.hmode) { if (o.minX != null) o.minMouseX = e.clientX - x + o.minX; if (o.maxX != null) o.maxMouseX = o.minMouseX + o.maxX - o.minX; } else { if (o.minX != null) o.maxMouseX = -o.minX + e.clientX + x; if (o.maxX != null) o.minMouseX = -o.maxX + e.clientX + x; } if (o.vmode) { if (o.minY != null) o.minMouseY = e.clientY - y + o.minY; if (o.maxY != null) o.maxMouseY = o.minMouseY + o.maxY - o.minY; } else { if (o.minY != null) o.maxMouseY = -o.minY + e.clientY + y; if (o.maxY != null) o.minMouseY = -o.maxY + e.clientY + y; } document.onmousemove = Drag.drag; document.onmouseup = Drag.end; return false; }, drag : function(e) { e = Drag.fixE(e); var o = Drag.obj; var ey = e.clientY; var ex = e.clientX; var y = parseInt(o.vmode ? o.root.style.top : o.root.style.bottom); var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right ); var nx, ny; if (o.minX != null) ex = o.hmode ? Math.max(ex, o.minMouseX) : Math.min(ex, o.maxMouseX); if (o.maxX != null) ex = o.hmode ? Math.min(ex, o.maxMouseX) : Math.max(ex, o.minMouseX); if (o.minY != null) ey = o.vmode ? Math.max(ey, o.minMouseY) : Math.min(ey, o.maxMouseY); if (o.maxY != null) ey = o.vmode ? Math.min(ey, o.maxMouseY) : Math.max(ey, o.minMouseY); nx = x + ((ex - o.lastMouseX) * (o.hmode ? 1 : -1)); ny = y + ((ey - o.lastMouseY) * (o.vmode ? 1 : -1)); if (o.xMapper) nx = o.xMapper(y) else if (o.yMapper) ny = o.yMapper(x) Drag.obj.root.style[o.hmode ? "left" : "right"] = nx + "px"; Drag.obj.root.style[o.vmode ? "top" : "bottom"] = ny + "px"; Drag.obj.lastMouseX = ex; Drag.obj.lastMouseY = ey; Drag.obj.root.onDrag(nx, ny); return false; }, end : function() { document.onmousemove = null; document.onmouseup = null; Drag.obj.root.onDragEnd( parseInt(Drag.obj.root.style[Drag.obj.hmode ? "left" : "right"]), parseInt(Drag.obj.root.style[Drag.obj.vmode ? "top" : "bottom"])); Drag.obj = null; }, fixE : function(e) { if (typeof e == 'undefined') e = window.event; if (typeof e.layerX == 'undefined') e.layerX = e.offsetX; if (typeof e.layerY == 'undefined') e.layerY = e.offsetY; return e; } }; function divOsClass(name) { this.name = name; this.Cookie = new Cookie(); this.sajaxIO = new sajaxIO(); this.setDebug(0); this.tagTitleVisibleStyle = "active"; this.tagTitleInVisibleStyle = "inactive"; this.tagContentVisibleStyle = "showThis"; this.tagContentInVisibleStyle = "hideThis"; this.waitWord = "Please waiting..."; this.contentDivPrefix = "C"; this.TagDivPrefix = "T"; this.ResizeFix = "0"; this.tagSeq = 10; this.popSeq = 10; this.act=""; this.imagedir = "images"; this.styledir = "style"; this.hashTable = new hashUtil(); this.tagUrl = new hashUtil(); this.hashTable.put("home",0); this.TagName = "C0"; this.popHandle = new hashUtil(); this.closeTagHtml = "
\"close\"\"\" ===TITLE===
"; this.Info = new Array(); this.getBrowser(); this.position=""; return this; } var tempHideDiv=""; divOsClass.prototype.AlertSuccess= 100; divOsClass.prototype.AlertFailed = 101; divOsClass.prototype.AlertWait= 102; divOsClass.prototype.AlertNote= 103; divOsClass.prototype.setInfo = function(p_word,p_info) { eval("this."+p_word+"='"+p_info+"'"); } divOsClass.prototype.refreshCloseTagHtml = function() { this.closeTagHtml = "
\"close\"\"\" ===TITLE===
"; } divOsClass.prototype.getBrowser = function() { var navi = window.navigator.userAgent.toUpperCase(); if (navi.indexOf("MSIE")>=1) this.browser = "IE"; else if (navi.indexOf("FIREFOX")>=1) this.browser = "FF"; return this.browser; } divOsClass.prototype.setTagDiv = function(tagname) { this.tagDivName = tagname; this.tagDiv = document.getElementById(tagname); } divOsClass.prototype.setContentDiv = function(main) { this.contentDivName = main; this.contentDiv = document.getElementById(main); } divOsClass.prototype.setDebug = function(p_debug) { if(p_debug) this._Debug = true; else this._Debug = false; } divOsClass.prototype.setTagCloseHtml = function(p_str) { this.closeTagHtml = p_str; } divOsClass.prototype.virtualOpen = function(p_url,p_name,p_target,p_icon,p_setcookie) { var tagSeq; if(p_name=='undefined' || p_name=='') return; tagSeq = this.addTag(p_name,p_icon); this.hashTable.put(p_target,tagSeq) ; this.tagUrl.put(tagSeq,p_url) ; if(typeof(p_setcookie)!="undefined" && p_setcookie) { var u=p_url.split("?"); this.Cookie.setCookie("_epage_tags",this.Cookie.getCookie("_epage_tags")+";;"+p_target+"=="+p_name+"=="+u[1]+"=="+p_icon); } } divOsClass.prototype.open = function(p_url,p_name,p_target,p_icon) { var tagSeq; if(p_target=='_blank' ) { tagSeq = this.addTag(p_name,p_icon); } else { tagSeq = this.hashTable.get(p_target); if(!this.hasTag(tagSeq) || tagSeq==null) { tagSeq = this.addTag(p_name,p_icon); var u=p_url.split("?"); this.Cookie.setCookie("_epage_tags",this.Cookie.getCookie("_epage_tags")+";;"+p_target+"=="+p_name+"=="+u[1]+"=="+p_icon); } else { this.tagUrl.remove(tagSeq); this.selectTag(tagSeq); } } this.hashTable.put(p_target,tagSeq) ; var contDiv = this.contentDivPrefix+tagSeq; this.openUrl(contDiv,p_url); } divOsClass.prototype.openUrl = function(p_div,p_url,p_silent) { if(p_url.indexOf("?")<0) p_url+="?"; else p_url+="&"; p_url+="TagName="+p_div; this.genDivContentCallBackFunction(p_div); this.sajaxIO.sajaxSubmit('','',this.name+".setdivContent"+p_div,'_displayProgram',p_url); if (!p_silent) divOs.openWaitingWindow(divOs.waitWord,"sending"); } divOsClass.prototype.openSajaxUrl = function(p_div,p_url) { if(p_url.indexOf("?")<0) p_url+="?"; else p_url+="&"; p_url+="TagName="+p_div; p_url+="&DivId="+p_div; this.sajaxIO.sajaxSubmit('','',divOsClass.prototype.DivSajaxCallBack,'sajaxSubmit',p_url); } divOsClass.prototype.openSubmitForm = function(p_title,p_url,p_form,p_param,p_style,p_event) { divid="tmp"+this.popSeq; this.openPopWindow(p_title,p_style,'',divid,p_event) ; this.submitForm('ppcont'+divid,p_url,p_form,p_param,'sajaxSubmit'); } divOsClass.prototype.submitForm = function() { a=divOsClass.prototype.submitForm.arguments; argDiv = a[0]; argUrl = a[1]; if(a[2]) argForm = a[2]; else argForm = ""; if(a[3]) argParam = a[3]; else argParam = ""; if(a[4]) argFun = a[4]; else argFun = "sajaxSubmit"; if(argUrl.indexOf("?")<0) argUrl+="?"; else argUrl+="&"; argUrl+="TagName="+argDiv; this.genDivSubmitCallBackFunction(argDiv); this.sajaxIO.sajaxSubmit(argParam,argForm,this.name+".setDivSubmitContent"+argDiv,argFun,argUrl); this.Cookie.setCookie(argDiv,argUrl); } divOsClass.prototype.DivSajaxCallBack= function(z) { var divOs_obj = eval("divOs"); if(divOs_obj._Debug) alert(z); Res= sajaxIO.prototype.getMsg(z); if(Res.DivId) $("#"+Res.DivId).html(Res.Content); if(Res.JsFunction) eval(Res.JsFunction); } divOsClass.prototype.getDivUrl = function(p_div) { var p = this.Cookie.getCookie(p_div); return p; } divOsClass.prototype.genDivContentCallBackFunction = function(p_div) { var str = "divOsClass.prototype.setdivContent"+p_div+" = function(z) {\n"; if(this._Debug) str+=" alert(z);\n"; str+= "var obj = document.getElementById('"+p_div+"');\n"; str+= "divOsClass.prototype.setInnerHTML(obj, z);\n"+ "divOs.closeWaitingWindow('sending');}"; if(this._Debug) alert(str); eval(str); } divOsClass.prototype.genDivSubmitCallBackFunction = function(p_div) { var str = "divOsClass.prototype.setDivSubmitContent"+p_div+" = function(z) {\n"; if(this._Debug) str+=" alert(z);\n"; str += "var ret = sajaxIO.prototype.getMsg(z);\n"+ "divOsClass.prototype.setInnerHTML(document.getElementById('"+p_div+"'),ret.Content);\n"+ "if(ret.JsFunction!='') eval(ret.JsFunction);\n"+ "return ret.Content;\n"+ "}\n"; if(this._Debug) alert(str); eval(str); } divOsClass.prototype.setInnerHTML = function (el, htmlCode) { if(el==null) return false; $(el).html(htmlCode); return; } divOsClass.prototype.createDiv = function(container,id,className) { if(typeof(container)=="string") containerObj = document.getElementById(container); else containerObj = container; var newDiv=document.createElement("DIV"); containerObj.appendChild(newDiv); newDiv.id=id; newDiv.className=className; } divOsClass.prototype.delDiv = function(container,id) { if(typeof(container)=="string") containerObj = document.getElementById(container); else containerObj = container; var child = document.getElementById(id); if(child==null) return false; containerObj.removeChild(child); } divOsClass.prototype.handleIEhasLayout=function(){ document.body.style.zoom = '1.1'; document.body.style.zoom = ''; } divOsClass.prototype.checkTagDivReady = function() { if(typeof(this.tagDiv)!='undefined') return true; return false; } divOsClass.prototype.addTag = function(p_name,p_icon) { var tagDivName = this.TagDivPrefix+this.tagSeq; var newLi=document.createElement("li"); newLi.id= tagDivName; newLi.className = this.tagTitleVisibleStyle ; var res = this.closeTagHtml.replace(/===TITLE===/,p_name); var icon = this.styledir+"/backstyle/back_skin_grey/icon/6.png"; if (typeof p_icon != 'undefined' && trim(p_icon)!='' && p_icon!='undefined') { icon = p_icon; } res = res.replace(/===ICON===/,icon); var str = " "; while(res!=str) { str = res; res = str.replace(/===TAG===/,this.tagSeq); } str = res; newLi.innerHTML = str; try{ this.tagDiv.appendChild(newLi); var contDivName = this.contentDivPrefix+this.tagSeq; this.createDiv(this.contentDiv,contDivName,this.tagContentVisibleStyle); this.selectTag(this.tagSeq); }catch(e) { if(this._Debug) alert(" addTag Exception \n"); this.tagDiv = document.getElementById(this.tagDivName); } return this.tagSeq++; } divOsClass.prototype.isEmptyDiv = function(p_div) { var tdiv = document.getElementById(p_div); if(tdiv==null) return false; if(tdiv.innerHTML.trim()) return false; return true; } divOsClass.prototype.hasTag = function(p_seq) { var tdiv = document.getElementById(this.TagDivPrefix+p_seq); if(tdiv==null) return false; return true; } divOsClass.prototype.delTag = function(p_seq) { this.delDiv(this.tagDiv,this.TagDivPrefix+p_seq); this.delDiv(this.contentDiv,this.contentDivPrefix+p_seq); var key = this.hashTable.getKey(p_seq); var newcookie = ""; var tags = this.Cookie.getCookie("_epage_tags").split(";;"); var tag; for(var i=0;iloading...",p_div); this.openUrl(divid,p_url); return false; } divOsClass.prototype.openPopSajaxUrl = function(p_title,p_style,p_url,p_div,p_event) { var divid = "urlPop"+this.popSeq; this.openPopWindow(p_title,p_style,"
loading...
",p_div,p_event); this.openSajaxUrl(divid,p_url); return false; } divOsClass.prototype.openAlertWindow = function(p_type,p_msg,p_style,p_div,p_button,p_title) { var divClass, icon,cont2=""; icon ="wait.gif"; if(!p_style) p_style="width:350;height:110;Button:ok;top:180"; if(p_type==divOsClass.prototype.AlertSuccess) icon ="success.png"; if(p_type==divOsClass.prototype.AlertWait) icon = "wait.gif"; if(p_type==divOsClass.prototype.AlertFailed) icon ="failure.png"; var cont;// = document.getElementById("ppcont"+seq); cont = "
"+p_msg+"
\n"; cont += "
\n"; if (p_button && p_button!="NoButton"){ while (p_button.getFirstKey()){ var BtnKey = p_button.getFirstKey(); if(BtnKey=='_Ok') cont+="\n"; if(BtnKey=='_Cancel') cont+="\n"; if(BtnKey=='_Js') cont2="\n"; if (BtnKey!="_Ok" && BtnKey!="_Cancel" && BtnKey!="_Js"){ var BtnVal = p_button.get(BtnKey).split("=o="); cont+=" \n"; } p_button.remove(BtnKey); } } else if(p_button!="NoButton") cont+="\n"; cont += "
"; cont += cont2; if(!p_title) p_title = window.location.host; var seq = this.openPopWindow(p_title,p_style,cont,p_div); return seq; } divOsClass.prototype.closeWaitingWindow = function(p_id) { if (!p_id) p_id="waitingId"; try { var obj = document.getElementById(p_id); obj.parentNode.removeChild(obj); }catch(e){} } divOsClass.prototype.openWaitingWindow = function(p_cont,p_id) { if (!p_id) p_id="waitingId"; var newDiv=document.createElement("DIV"); newDiv.id = p_id; document.body.appendChild(newDiv); str="
Close

"+p_cont+"

"; this.setInnerHTML(newDiv,str); } divOsClass.prototype.changePopTitle = function(p_divid,p_title) { try{ var headDiv = document.getElementById(p_divid+"__overPopTitle"); divOsClass.prototype.setInnerHTML(headDiv,"

"+strUtil.prototype.htmlspecialchars(decodeURIComponent(p_title))+"

"); }catch(e){} } divOsClass.prototype.openPopWindow = function(p_title,p_style,p_cont,p_div,event) { if(p_div!="") { var checkObj=document.getElementById(p_div); if(checkObj) return false; } var divWidth="100%",divHeight=300,divTop=70,divLeft=0,divStatic=1,divSpeed=0; var Maximize = false; var Close = true; var ret ; var divNavigate=false; var divFoot=false; var Nav = ""; if(typeof p_style!="undefined") { ret = p_style.split(";"); for(var i=0;i\n"+ "var popMaxWidth =document.body.offsetWidth-80;\n"+ "var popMaxHeight =document.body.offsetHeight-100;\n"; if(event){ str +="var h=document.getElementById(\""+newDiv.id+"\");\n"+ "var o=document.getElementById(\""+newDiv.id+"__overPopTitle\");\n"+ "Drag.init(o,h,0,popMaxWidth,0,popMaxHeight);\n"; }else{ str +="var h=document.getElementById(\""+newDiv.id+"__movePopOut\");\n"+ "var o=document.getElementById(\""+newDiv.id+"__overPopTitle\");\n"+ "Drag.init(o,h,0,popMaxWidth,0,popMaxHeight);\n"; } if(!event) str +="__InitPopDiv(o,h);\n"; str +="h.onDragEnd = function (x, y) {RecP(x,y,h);}\n"+ "function RecP(x,y,h){\n"+ "if(divOs.position==\"back\"){\n"+ "if(x){Cookie.prototype.setCookie(\"__movePopOut_back_x\",x);}\n"+ "if(y){Cookie.prototype.setCookie(\"__movePopOut_back_y\",y);}\n"+ "}else{\n"+ "if(x){Cookie.prototype.setCookie(\"__movePopOut_front_x\",x);}\n"+ "if(y){Cookie.prototype.setCookie(\"__movePopOut_front_y\",y);}\n"+ "}\n"+ "}\n"+ "function __InitPopDiv(o,h)\n"+ "{h.style.position=\"absolute\";\n"+ "o.style.cursor=\"move\";\n"+ "if(divOs.position==\"back\"){\n"+ "var a=Cookie.prototype.getCookie(\"__movePopOut_back_x\");\n"+ "var b=Cookie.prototype.getCookie(\"__movePopOut_back_y\");\n"+ "}else{\n"+ "var a=Cookie.prototype.getCookie(\"__movePopOut_front_x\");\n"+ "var b=80;\n"+ "}\n"+ "if(a==null || a==\"\"){\n"+ "var tmpWidth=parseInt(\""+divWidth+"\");\n"+ "if(tmpWidth==\""+divWidth+"\"){\n"+ "a=(popMaxWidth/2)-(tmpWidth/2);\n"+ "}else a=popMaxWidth*(100-tmpWidth)/200;\n"+ "b=30;\n"+ "}\n"+ "if (a!=null&&a!=\"\"){ a=parseInt(a)+\"px\";\n h.style.left=a; }\n"+ "if (b!=null&&b!=\"\"){ b=parseInt(b)+\"px\";\n h.style.top=b; }\n"+ "}\n"+ "\n"; str += "
"; if(event){ str += "
\n"+ "
\n"+ "
\n"; } else{ str += "
\n"+ "
\n"+ "
\n"; } str+="

"+strUtil.prototype.htmlspecialchars(decodeURIComponent(p_title))+"

\n"; if(Close) { str+= "
\n"; } str+="
\n"; var navigateHeight=0; if(divNavigate==1) { str+="
\n"; navigateHeight=61; } else if(divNavigate==2) { str+="
\n"; navigateHeight=36; } if(divFoot) navigateHeight+=43; if(typeof(p_cont)=='object') { str+= "
"+p_cont.innerHTML+"\n"; } else str+= "
"+p_cont+"\n"; str+= "
\n"; str+= "
\n"; str+= "
\n"; str+= "
\n"; this.setInnerHTML(newDiv,str); var fullDiv = document.getElementById("fullDiv"+this.popSeq); var ppcontent = document.getElementById(ppcontId); var underLay = document.getElementById("underLay"+this.popSeq); if(divTop) { newDiv.style.top = divTop+"px"; } if(divLeft) { newDiv.style.left = divLeft+"px"; } if(event){ var chkTopSide=false; var chkLeftSide=false; var bodywidth = document.body.offsetWidth; var bodyheight ; if(document.documentElement) bodyheight = document.documentElement.clientHeight; else bodyheight = document.body.offsetHeight; var chktop =parseInt(event.clientY) + parseInt(divHeight); var chkleft=parseInt(event.clientX) + parseInt(divWidth); if(chktop > bodyheight){ chkTopSide=true; newtop=parseInt(event.clientY) - parseInt(divHeight); if(newtop<0) newtop=10; } else newtop=event.clientY; newDiv.style.top = newtop+"px"; if(chkleft > bodywidth){ chkLeftSide=true; newleft=parseInt(event.clientX)-parseInt(divWidth)-215; if(newleft<0) newleft=10; }else newleft=event.clientX-215; newDiv.style.left = newleft+"px"; divWidthSm =20; divHeightSm =20; divSpeed =10; } if(divWidth) { if(divWidth.indexOf("%")!=-1) { fullDiv.parentNode.parentNode.style.width = divWidth; if (this.browser=="FF") ppcontent.style.width="100%"; } else { fullDiv.parentNode.parentNode.style.width=divWidth+"px"; if (this.browser=="FF") ppcontent.style.width="100%";//divWidth+"px"; } } if(divHeight) { if(divHeight.indexOf("%")!=-1) { var myOffset = 0; if (this.browser=="FF") myOffset = 0; newDivHeight=(document.documentElement.clientHeight-myOffset)*divHeight.slice(0,-1)/100; if(newDivHeight>(divTop+myOffset)) newDivHeight = newDivHeight-AbsDivTop-myOffset; if(newDivHeight<40) newDivHeight=40; fullDiv.style.height=newDivHeight+"px"; h = newDivHeight+3; $(newDiv).children("DIV").css("height",h); ppcontent.style.height=(newDivHeight-27-navigateHeight)+"px"; underLay.style.height=(newDivHeight+2)+"px"; } else{ divHeight = parseInt(divHeight); if(divHeight<40) divHeight=40; fullDiv.style.height=divHeight+"px"; h = divHeight+3; $(newDiv).children("DIV").css("height",h); ppcontent.style.height=(parseInt(divHeight)-27-navigateHeight)+"px"; underLay.style.height =(parseInt(divHeight)+2)+"px"; } } if(divWidth && divHeight && divSpeed){ $(newDiv).children("DIV").css("width",divWidthSm+"px"); $(newDiv).children("DIV").css("height",divHeightSm+"px"); newDiv.style.left = event.clientX+"px"; newDiv.style.top = (event.clientY+parseInt(divOsClass.prototype.getScrollTop()))+"px"; widthSpeed = (divWidth-divWidthSm)/10; heightSpeed = (divHeight-divHeightSm)/10; if(widthSpeed<10) widthSpeedperH=10; if(heightSpeed<10) heightSpeed=10; divOsClass.prototype.ActiveDiv(p_div,chkTopSide,chkLeftSide,divWidth,divHeight,widthSpeed,heightSpeed,divSpeed); $(p_div).children("DIV").css("overflow","hidden");; } if(true) { var floatDiv=document.createElement("DIV"); document.body.appendChild(floatDiv); floatDiv.id="floatDiv"+this.popSeq; floatDiv.className="floatDiv_1"; floatDiv.style.height=document.documentElement.scrollHeight; var clientHeight = document.documentElement.clientHeight; floatDiv.innerHTML=""; } this.popHandle.put(this.popSeq,newDiv.id) ; return this.popSeq++; } divOsClass.prototype.freePopdivHeight =function(p_div) { var obj = document.getElementById(p_div); if(obj.style.height) { obj.style.height='auto'; obj.style.position='static'; obj.style.padding='0 0 0 0'; obj.style.overflowY='hidden'; obj.parentNode.parentNode.parentNode.style.height="auto"; obj.parentNode.parentNode.parentNode.style.overflow=""; obj.parentNode.parentNode.parentNode.style.overflow=""; obj.parentNode.style.height="auto"; divOs.nextSibling(obj.parentNode).style.height="auto"; } } divOsClass.prototype.ActiveDiv =function(p_div,chkTop,chkLeft,Rwidth,Rheight,width,height,speed){ obj = document.getElementById(p_div); var fixHeight=false; if($(obj).children("DIV").css("height")=='auto') fixHeight = true; if(!fixHeight) { var height = $(obj).children("DIV").css("height").split('px')[0]; var perH = (Rheight-height)/7; } var width = $(obj).children("DIV").css("width").split('px')[0]; var top = obj.style.top.split('px')[0]; var left = obj.style.left.split('px')[0]; if((Rwidth-width)>140) var perW = (Rwidth-width)/7; else perW=20; if (width < Rwidth){ if(!fixHeight && heightRwidth) { Rheight+=10; $(obj).children("DIV").css("height",Rheight+"px"); } if(top<0) top=0; if(left<0) left=0; obj.style.top = top+"px"; obj.style.left = left+"px"; clearTimeout(this.act); this.act = setTimeout('divOsClass.prototype.ActiveDiv(\"'+p_div+'\",'+chkTop+','+chkLeft+','+Rwidth+','+Rheight+','+width+','+height+','+speed+')', speed); } return false; } divOsClass.prototype.popWindow = divOsClass.prototype.openPopWindow ; divOsClass.prototype.closePopWindow = function(p_div) { if(strUtil.prototype.isInteger(p_div)) p_seq = p_div; else p_seq = this.popHandle.getKey(p_div); try{ var floatDiv = document.getElementById("floatDiv"+p_seq); var obj = document.getElementById(this.popHandle.get(p_seq)); obj.parentNode.removeChild(obj); floatDiv.parentNode.removeChild(floatDiv); }catch(e){} } divOsClass.prototype.closeAllPopWindow = function(p_from) { if(!p_from) p_from=this.popSeq; var p_to=p_from-10; if(p_to<0) p_to=0; for (var i=p_from;i>p_to;i--){ try{ divOs.closePopWindow(i); }catch(e){} } } divOsClass.prototype.getPopHandle = function(p_seq) { return this.popHandle.get(p_seq); } divOsClass.prototype.getParentNodeById = function(p_obj,p_id,p_islike){ var str = new String(); if(p_id == "") return p_obj.parentNode; if(p_obj==null) return null; if(typeof(p_obj)=="undefined" || p_obj.tagName.toLowerCase()=="body") return null; p_obj = p_obj.parentNode; if(p_obj==null) return null; if(p_obj.id=="") return divOsClass.prototype.getParentNodeById(p_obj,p_id,p_islike); if(p_islike){ str = p_obj.id; if(str.indexOf(p_id)>-1){ return p_obj; } else return divOsClass.prototype.getParentNodeById(p_obj,p_id,p_islike); } else{ if(p_obj.id==p_id) return p_obj; else return divOsClass.prototype.getParentNodeById(p_obj,p_id,p_islike); } } divOsClass.prototype.getParentForm = function(p_obj){ while(p_obj.tagName.toLowerCase()!="body" && p_obj.tagName.toLowerCase()!="form") { p_obj = p_obj.parentNode; } if(p_obj.tagName.toLowerCase()=="form") return p_obj; else return null; } divOsClass.prototype.previousSibling = function(p_obj){ if(typeof(p_obj.previousSibling.tagName)=='undefined') return divOsClass.prototype.previousSibling(p_obj.previousSibling); else return p_obj.previousSibling; } divOsClass.prototype.childNode = function(p_obj,p_seq){ var counter = 0; try{ for(var i=0;i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i"9") return false; } return true; } strUtil.prototype.isPosInteger = function() { a=strUtil.prototype.isPosInteger.arguments; if(typeof(a[0])!='undefined') p_in = a[0]; else p_in = this.String; var p_val = p_in.toString(); for(var i=0;i"9") return false; } return true; } strUtil.prototype.isEmpty = function () { a=strUtil.prototype.isEmpty.arguments; if(typeof(a[0])!='undefined') p_in = a[0]; else p_in = this.String; p_val = this.trim(p_in); if(p_val == null || p_val=="") return true; if(p_val.length==0) return true; return false; } strUtil.prototype.isEmail = function(){ a=strUtil.prototype.isEmail.arguments; if(typeof(a[0])!='undefined') p_in = a[0]; else p_in = this.String; var reg = new RegExp("^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z-]+\.)+[a-zA-Z]{2,3}$"); if(p_in.search(reg)!=-1) return true; else return false; } strUtil.prototype.isCode = function() { a=strUtil.prototype.isCode.arguments; if(typeof(a[0])!='undefined') p_in = a[0]; else p_in = this.String; var reg =new RegExp(/^[a-z\d\_]+$/i); if(p_in.search(reg)!=-1) return true; else return false; } strUtil.prototype.ltrim = function(p_str) { a=strUtil.prototype.ltrim.arguments; if(typeof(a[0])!='undefined') p_str = a[0]; else p_str = this.String; return p_str.replace(/(^\s*)/g, ""); } strUtil.prototype.trim = function(p_str) { a=strUtil.prototype.trim.arguments; if(typeof(a[0])!='undefined') p_str = a[0]; else p_str = this.String; return p_str.replace(/(^\s*)|(\s*$)/g, ""); } String.prototype.trim = function() { return this.replace(/(^\s*)|(\s*$)/g, ""); } strUtil.prototype.rtrim = function(p_str) { a=strUtil.prototype.rtrim.arguments; if(typeof(a[0])!='undefined') p_str = a[0]; else p_str = this.String; return p_str.replace(/(\s*$)/g, ""); } strUtil.prototype.wipeTag = function(p_str,p_tag) { var reg = new RegExp("<"+p_tag+"[^>]*>([\\s|\\S]*?)<\\/"+p_tag+"\\s*>","i"); p_str = p_str.replace(reg,""); return p_str; } strUtil.prototype.wipeScript = function(p_str) { var reg1 = /]*>([\s|\S]*?)<\/script\s*>/i; var reg2 = /]*>([\s|\S]*?)<\/iframe\s*>/i; var reg3 = /]*>([\s|\S]*?)<\/frameset\s*>/i; var reg4 = /]*>([\s|\S]*?)<\/a\s*>/i; p_str = p_str.replace(reg1,""); p_str = p_str.replace(reg2,""); p_str = p_str.replace(reg3,""); p_str = p_str.replace(reg4,""); return p_str; } strUtil.prototype.striptags = function(p_str) { var reg1 = /<[^>]*>/i; var reg2 = /<\/[^>]*>/i; var reg3 = / /i; p_str = p_str.replace(reg1,""); p_str = p_str.replace(reg2,""); p_str = p_str.replace(reg3,""); return p_str; } strUtil.prototype.wipeForm = function(p_str) { var reg1 = /]*>/i; var reg2 = /<\/form[^>]*>/i; p_str = p_str.replace(reg1,""); p_str = p_str.replace(reg2,""); return p_str; } strUtil.prototype.addslashes = function (str) { str=str.replace(/\'/g,'\\\''); str=str.replace(/\"/g,'\\"'); str=str.replace(/\\/g,'\\\\'); str=str.replace(/\0/g,'\\0'); return str; } strUtil.prototype.stripslashes = function (str) { str=str.replace(/\\'/g,'\''); str=str.replace(/\\"/g,'"'); str=str.replace(/\\\\/g,'\\'); str=str.replace(/\\0/g,'\0'); return str; } strUtil.prototype.nl2br = function (str) { return str.replace(/(\r\n)|(\n\r)|\r|\n/g,"
"); } strUtil.prototype.directShowInput = function (str) { return strUtil.prototype.nl2br(strUtil.prototype.htmlspecialchars(strUtil.prototype.stripslashes(str))); } strUtil.prototype.htmlspecialchars = function(str) { str = str.replace(/\/g,">"); str = str.replace(/\"/g,"""); return str; } strUtil.prototype.reversespecialchars = function(str) { str = str.replace(/</g,"<"); str = str.replace(/>/g,">"); str = str.replace(/"/g,"\""); str = str.replace(/&/g,"&"); return str; } strUtil.prototype.markIp = function () { a=strUtil.prototype.markIp.arguments; ip = a[0]; if(typeof(a[1])!='undefined') part = a[1]; else part = 3; if(part>4) return ip; ret = ip.split("."); str=""; for(i=0;i1000 && p_year<=9999)) return false; if(!(!isNaN(p_month) && p_month>=1 && p_month<=12)) return false; if(!(!isNaN(p_day) && p_day>=1 && p_day<=this.monthdays(p_year,p_month))) return false; return true; } dateUtil.prototype.isDates = function(p_date) { deli =''; for(i=0;i<=p_date.length;i++){ c=p_date.substring(i,i+1); switch (c) { case '-' : deli = '-' break; case '/' : deli = '/' break; case ':' : deli = ':' break; case '.' : deli = '.' break; case ',' : deli = ',' break; case "'" : deli = "'" break; } if (deli!="") break; } if(deli=="") return false; l_date=p_date.split(deli); if(l_date.length>3) return false; try { if(!this.validdate(l_date[0],l_date[1],l_date[2])) return false; }catch(e){return false;} return true; } function dataCheck() { this.ErrMsg = new Array(); this.ErrMsg[2] = "Please Input Something!"; this.ErrMsg[1] = "Error1!"; return this; } dataCheck.prototype.setField = function(p_field) { this.screenField = p_field; } dataCheck.prototype.setName = function(p_name) { this.screenName = p_name; } dataCheck.prototype.setNull = function(p_null) { this.screenNull = p_null; } dataCheck.prototype.setType = function(p_type) { this.screenType = p_type; } dataCheck.prototype.getObj = function(p_form,p_name,p_prefix) { var obj ; if(typeof(p_form)=='object') { obj = eval("p_form."+p_prefix+p_name); } else { obj = eval("document."+p_form+"."+p_prefix+p_name); } if(!obj) return false; return obj; } dataCheck.prototype.setMsg = function(p_msg) { this.ErrMsg = p_msg; } dataCheck.prototype.datavalid = function(p_form,p_prefix) { var msg = ""; var focusobj ; var flag = 1; var f_length = this.screenField.length; var strUtl = new strUtil(''); for(var i=0;i0) return false; return true; } hashUtil.prototype.pop = function() { var l_key = this.getFirstKey(); var l_val = this.getFirst(); this.remove(l_key); return l_val; } hashUtil.prototype.read = function() { var ret = this.queueSeq.split(this.Sep); if(typeof(ret[this.Pointer])=="undefined") return ""; var l_key = ret[this.Pointer++]; var l_val = this.get(l_key); return l_val; } hashUtil.prototype.isEOF = function() { if(this.Pointer>=this.Length) return true; return false; } hashUtil.prototype.get = function(key) { if(typeof this.Storage[key] == "undefined") return null; else return this.Storage[key]; } hashUtil.prototype.getKey = function(val) { if(typeof this.RevStorage[val] == "undefined") return null; return this.RevStorage[val]; } hashUtil.prototype.mvToFirst = function(key) { this.queueSeq = this.queueSeq.replace(key+this.Sep,""); this.queueSeq = key+this.Sep+this.queueSeq; } hashUtil.prototype.getFirst = function() { while(true) { var key = this.queueSeq.substring(0,this.queueSeq.indexOf(this.Sep)); if(typeof this.Storage[key] == "undefined") { this.queueSeq = this.queueSeq.substring(this.queueSeq.indexOf(this.Sep)); } return this.Storage[key]; } } hashUtil.prototype.getFirstKey = function() { while(true) { var key = this.queueSeq.substring(0,this.queueSeq.indexOf(this.Sep)); if(typeof this.Storage[key] == "undefined") break; return key; } } hashUtil.prototype.hasKey = function(key) { if(typeof this.Storage[key] == "undefined") return false; return true; } hashUtil.prototype.hasValue = function(val) { if(typeof this.RevStorage[val] == "undefined") return false; return true; } hashUtil.prototype.remove = function(key) { this.queueSeq = this.queueSeq.replace(key+this.Sep,""); var val = this.Storage[key] ; delete this.Storage[key]; delete this.RevStorage[val]; this.Length--; } hashUtil.prototype.reset = function() { this.Storage = new Object(); this.RevStorage = new Object(); this.queueSeq = ""; this.Length=0; this.Pointer = 0; return this; } hashUtil.prototype.resetPointer = function() { this.Pointer=0; } function Scroll(p_width,p_height,p_speed,p_direct){ this.ns = (document.layers)? true:false this.ie = (document.all)? true:false this.preTop = 0; this.preLeft = 0; this.moveLimit = 0; this.currentLeft = 0; this.currentTop = 0; this.marquee_name = ""; this.template_name = ""; this.marquee_hidden = ""; this.marquee_width = p_width; this.marquee_height = p_height; this.marquee_speed = p_speed; this.marquee_direct = p_direct; this.setMarObject = setMarObject; this.setTempObject = setTempObject; this.setHiddenObject = setHiddenObject; this.beginScroll = beginScroll; this.scrollInit = scrollInit; this.scrollUp = scrollUp; this.scrollDown = scrollDown; this.scrollRight = scrollRight; this.scrollLeft = scrollLeft; this.getObject = getObject; return this; } function setTempObject(p_obj){ this.template_name = p_obj; } function setMarObject(p_obj){ this.marquee_name = p_obj; } function setHiddenObject(p_obj){ this.marquee_hidden = p_obj; } function getObject(p_obj){ if(typeof(p_obj)=="string") { if(this.ie) return eval("document.all."+p_obj); else return document.getElementById(p_obj);//Joyce firefox method } else { if(this.ie) return eval("p_obj"); else return p_obj; } } function beginScroll(){ var marq = this.getObject(this.marquee_name); var temp = this.getObject(this.template_name); with(marq){ style.height = this.marquee_height+'px';//Joyce add "px" if(this.marquee_direct == 'up' || this.marquee_direct == 'down'){ style.overflowX="visible"; style.overflowY="hidden"; } else{ style.overflowX="hidden"; style.overflowY="visible"; } var myStopValue = this.marquee_hidden+ "= 1"; var myStartValue = this.marquee_hidden + "=0"; marq.onmouseover = new Function(myStopValue); marq.onmouseout = new Function(myStartValue); } } function scrollInit(){ var marq = this.getObject(this.marquee_name); var temp = this.getObject(this.template_name); var tmpstr; var Nheight=this.marquee_height/4; var Nwidth=this.marquee_width/4; if(this.marquee_direct == "up" || this.marquee_direct == "down") marq.innerHTML += ""; else marq.innerHTML += ""; tmpstr = marq.innerHTML; if(this.marquee_direct == "up" || this.marquee_direct == "down"){ marq.noWrap = false; temp.noWrap = false; var marq_height = temp.offsetHeight; var counter = 0; while(!marq_height) { if(counter++>1000) { marq_height=100; break; } marq_height = temp.offsetHeight; } while(marq_height < this.marquee_height){ marq_height += marq_height; tmpstr+=marq.innerHTML; } }else{ marq.noWrap = true; temp.noWrap = true; var marq_width = temp.offsetWidth; var counter = 0; while(!marq_width) { if(counter++>1000) { marq_width=100; break; } marq_width = temp.offsetWidth; } while(marq_width < this.marquee_width){ marq_width += marq_width; tmpstr+=marq.innerHTML; } } if(this.marquee_direct == "up" || this.marquee_direct == "down"){ if(temp.offsetHeight<2*marq.offsetHeight) marq.innerHTML = tmpstr+tmpstr; else marq.innerHTML = tmpstr; } else { if(temp.offsetWidth<2*marq.offsetWidth) marq.innerHTML = tmpstr+tmpstr; else marq.innerHTML = tmpstr; } temp.innerHTML = ""; var param_up = "this.scrollUp('"+this.marquee_name+"','"+this.template_name+"',"+this.marquee_hidden+","+this.marquee_height+")"; var param_down = "this.scrollDown('"+this.marquee_name+"','"+this.template_name+"','"+this.marquee_hidden+"',"+this.marquee_height+")"; var param_left = "this.scrollLeft('"+this.marquee_name+"','"+this.template_name+"',"+this.marquee_hidden+","+this.marquee_width+")"; var param_right = "this.scrollRight('"+this.marquee_name+"','"+this.template_name+"','"+this.marquee_hidden+"',"+this.marquee_width+")"; if(this.marquee_direct == "up") setInterval(param_up,this.marquee_speed); if(this.marquee_direct == "left") setInterval(param_left,this.marquee_speed); if(this.marquee_direct == "right") setInterval(param_right,this.marquee_speed); if(this.marquee_direct == "down") setInterval(param_down,this.marquee_speed); } function scrollUp(p_marquee,p_template,p_stop,p_height){ var stop_value = eval(p_stop); if(stop_value == 1) return; var marq = this.getObject(p_marquee); var temp = this.getObject(p_template); this.preTop = marq.scrollTop; marq.scrollTop += 1; if(this.preTop == marq.scrollTop){ marq.scrollTop = temp.offsetHeight- p_height + 1; marq.scrollTop += 1; } } function scrollRight(p_marquee,p_template,p_stop,p_width){ var stop_value = eval(p_stop); if(stop_value == 1) return; var marq = this.getObject(p_marquee); var temp = this.getObject(p_template); this.preLeft = marq.scrollLeft; marq.scrollLeft -= 1; if(this.preLeft == marq.scrollLeft){ if(!this.moveLimit){ marq.scrollLeft = temp.offsetWidth*2; this.moveLimit = marq.scrollLeft; } marq.scrollLeft = this.moveLimit - temp.offsetWidth + p_width; marq.scrollLeft -= 1; } } function scrollDown(p_marquee,p_template,p_stop,p_height){ var stop_value = eval(p_stop); if(stop_value == 1) return; var marq = this.getObject(p_marquee); var temp = this.getObject(p_template); this.preTop = marq.scrollTop; marq.scrollTop -= 1; if(this.preTop == marq.scrollTop){ if(!this.moveLimit){ marq.scrollTop = temp.offsetHeight*2; this.moveLimit = marq.scrollTop; } marq.scrollTop = this.moveLimit - temp.offsetHeight + p_height; marq.scrollTop -= 1; } } function scrollLeft(p_marquee,p_template,p_stop,p_width){ var stop_value = eval(p_stop); if(stop_value == 1) return; var marq = this.getObject(p_marquee); var temp = this.getObject(p_template); marq.noWrap = true; this.preLeft = marq.scrollLeft; marq.scrollLeft = marq.scrollLeft + 1; if(this.preLeft == marq.scrollLeft){ marq.scrollLeft = temp.offsetWidth - p_width + 1; marq.scrollLeft += 1; } } function begin_frame(p_id,p_pct, p_pix,p_height,p_speed) { marq_frame = new Scroll(marqueWidth,p_height,p_speed,'up'); if(p_pct>0) var marqueWidth = screen.width * p_pct * 0.82 / 100 ; if(p_pix>0) var marqueWidth = p_pix; marq_frame.setMarObject(p_id); marq_frame.setTempObject(p_id+"_temp"); marq_frame.setHiddenObject(p_id+"_stop"); marq_frame.beginScroll(); marq_frame.scrollInit(); } function startScroll(marquee_id,p_height,p_speed) { eval(marquee_id+"_stop =0;"); eval(marquee_id+"_Width =0;"); eval("marq_"+marquee_id+" = new Scroll("+marquee_id+"_Width,p_height,p_speed,'up');"); eval("marq_"+marquee_id+".setMarObject('"+marquee_id+"');"); eval("marq_"+marquee_id+".setTempObject('"+marquee_id+"_temp');"); eval("marq_"+marquee_id+".setHiddenObject('"+marquee_id+"_stop');"); eval("marq_"+marquee_id+".beginScroll();"); eval("marq_"+marquee_id+".scrollInit();"); } function resize(p_TagName,p_fix,p_home) { if (!p_TagName) p_TagName="C0"; if (!p_fix) p_fix=0; var WinHeight = document.documentElement.clientHeight - (p_fix); try{ var mc1 = document.getElementById("main"); var mc2 = document.getElementById("sidebar"); var mc3 = eval("document.getElementById('"+p_TagName+"_maincontent')"); var mc4 = document.getElementById("listTB"); var statusbar = document.getElementById(p_TagName+"_statusbar"); var statHeight = 0; if(typeof(statusbar)=="object") { try{ statHeight = statusbar.clientHeight; }catch(e) {} } mc1.style.height = (WinHeight - 60)+"px"; mc2.style.height = (WinHeight - 62)+"px"; mc3.style.height = (WinHeight - 125-statHeight)+"px"; if(eval("document.getElementById('"+p_TagName+"_mainDiv')")){ var mc3 = eval("document.getElementById('"+p_TagName+"_mainDiv')"); var mc4 = eval("document.getElementById('"+p_TagName+"_showDiv')"); mc3.style.height = (WinHeight - 125 - statHeight)+"px"; mc4.style.height = (WinHeight - 125)+"px"; } if(eval("document.getElementById('"+p_TagName+"_mainPgDiv')")){ var mc3 = eval("document.getElementById('"+p_TagName+"_mainPgDiv')"); var mc4 = eval("document.getElementById('"+p_TagName+"_showDiv')"); mc3.style.height = (WinHeight - 155 - statHeight)+"px"; mc4.style.height = (WinHeight - 125)+"px"; } }catch(e){}//alert(e.message)} checktab(30,3); } function ShowHide() { for (i=0;i=1) pData[i] = Array(a[i].textContent); else pData[i] = Array(a[i].innerText); } return pData; } var allItem = new Array(); function checktab(_ext,space) { var _allItem = new Array(); var showItem = new Array(); var hideItem = new Array(); var hideItemName = new Array(); var pData = findElementId("maintbul","li"); var pName = findElementText("maintbul","li"); var a = pData.length; var b = document.getElementById("main").clientWidth; var allwidth = j = k = 0; for (i=0;i0) { var _hideItem = ""; for (m=0;m"+tagName+"  X',"; document.getElementById("exttab").style.display = "none"; } _hideItem=_hideItem.slice(0,-1); setTimeout("showExt("+_hideItem+")",200); } else { hideExt(); } _allItem[0]=showItem; _allItem[1]=hideItem; allItem = _allItem; } function showExt() { var _Ext = document.getElementById("exttab"); var _ExtArrow = document.getElementById("exttabarrow"); var _ExtVal = ""; _ExtArrow.style.display = "block"; _Ext.innerHTML = ""; for (i=0; i= this.m_atts.length)) ? null : this.m_atts[index][XMLP._ATT_NAME]; } XMLP.prototype.getAttributeValue = function(index) { return ((index < 0) || (index >= this.m_atts.length)) ? null : __unescapeString(this.m_atts[index][XMLP._ATT_VAL]); } XMLP.prototype.getAttributeValueByName = function(name) { return this.getAttributeValue(this._findAttributeIndex(name)); } XMLP.prototype.getColumnNumber = function() { return SAXStrings.getColumnNumber(this.m_xml, this.m_iP); } XMLP.prototype.getContent = function() { return (this.m_cSrc == XMLP._CONT_XML) ? this.m_xml : this.m_cAlt; } XMLP.prototype.getContentBegin = function() { return this.m_cB; } XMLP.prototype.getContentEnd = function() { return this.m_cE; } XMLP.prototype.getLineNumber = function() { return SAXStrings.getLineNumber(this.m_xml, this.m_iP); } XMLP.prototype.getName = function() { return this.m_name; } XMLP.prototype.next = function() { return this._checkStructure(this._parse()); } XMLP.prototype._parse = function() { if(this.m_iP == this.m_xml.length) { return XMLP._NONE; } if(this.m_iP == this.m_xml.indexOf("= iE)) { return iNB; } iEq = this.m_xml.indexOf("=", iNB); if((iEq == -1) || (iEq > iE)) { return this._setErr(XMLP.ERR_ATT_VALUES); } iNE = SAXStrings.lastIndexOfNonWhitespace(this.m_xml, iNB, iEq); iVB = SAXStrings.indexOfNonWhitespace(this.m_xml, iEq + 1, iE); if((iVB == -1) ||(iVB > iE)) { return this._setErr(XMLP.ERR_ATT_VALUES); } cQuote = this.m_xml.charAt(iVB); if(SAXStrings.QUOTES.indexOf(cQuote) == -1) { return this._setErr(XMLP.ERR_ATT_VALUES); } iVE = this.m_xml.indexOf(cQuote, iVB + 1); if((iVE == -1) ||(iVE > iE)) { return this._setErr(XMLP.ERR_ATT_VALUES); } strN = this.m_xml.substring(iNB, iNE + 1); strV = this.m_xml.substring(iVB + 1, iVE); if(strN.indexOf("<") != -1) { return this._setErr(XMLP.ERR_ATT_LT_NAME); } if(strV.indexOf("<") != -1) { return this._setErr(XMLP.ERR_ATT_LT_VALUE); } strV = SAXStrings.replace(strV, null, null, "\n", " "); strV = SAXStrings.replace(strV, null, null, "\t", " "); iRet = this._replaceEntities(strV); if(iRet == XMLP._ERROR) { return iRet; } strV = this.m_cAlt; if(this._findAttributeIndex(strN) == -1) { this._addAttribute(strN, strV); } else { return this._setErr(XMLP.ERR_ATT_DUP); } this.m_iP = iVE + 2; return XMLP._ATT; } XMLP.prototype._parseCDATA = function(iB) { var iE = this.m_xml.indexOf("]]>", iB); if (iE == -1) { return this._setErr(XMLP.ERR_CLOSE_CDATA); } this._setContent(XMLP._CONT_XML, iB, iE); this.m_iP = iE + 3; return XMLP._CDATA; } XMLP.prototype._parseComment = function(iB) { var iE = this.m_xml.indexOf("-" + "->", iB); if (iE == -1) { return this._setErr(XMLP.ERR_CLOSE_COMMENT); } this._setContent(XMLP._CONT_XML, iB, iE); this.m_iP = iE + 3; return XMLP._COMMENT; } XMLP.prototype._parseDTD = function(iB) { var iE, strClose, iInt, iLast; iE = this.m_xml.indexOf(">", iB); if(iE == -1) { return this._setErr(XMLP.ERR_CLOSE_DTD); } iInt = this.m_xml.indexOf("[", iB); strClose = ((iInt != -1) && (iInt < iE)) ? "]>" : ">"; while(true) { if(iE == iLast) { return this._setErr(XMLP.ERR_INFINITELOOP); } iLast = iE; iE = this.m_xml.indexOf(strClose, iB); if(iE == -1) { return this._setErr(XMLP.ERR_CLOSE_DTD); } if (this.m_xml.substring(iE - 1, iE + 2) != "]]>") { break; } } this.m_iP = iE + strClose.length; return XMLP._DTD; } XMLP.prototype._parseElement = function(iB) { var iE, iDE, iNE, iRet; var iType, strN, iLast; iDE = iE = this.m_xml.indexOf(">", iB); if(iE == -1) { return this._setErr(XMLP.ERR_CLOSE_ELM); } if(this.m_xml.charAt(iB) == "/") { iType = XMLP._ELM_E; iB++; } else { iType = XMLP._ELM_B; } if(this.m_xml.charAt(iE - 1) == "/") { if(iType == XMLP._ELM_E) { return this._setErr(XMLP.ERR_ELM_EMPTY); } iType = XMLP._ELM_EMP; iDE--; } iDE = SAXStrings.lastIndexOfNonWhitespace(this.m_xml, iB, iDE); if (iE - iB != 1 ) { if(SAXStrings.indexOfNonWhitespace(this.m_xml, iB, iDE) != iB) { return this._setErr(XMLP.ERR_ELM_NAME); } } this._clearAttributes(); iNE = SAXStrings.indexOfWhitespace(this.m_xml, iB, iDE); if(iNE == -1) { iNE = iDE + 1; } else { this.m_iP = iNE; while(this.m_iP < iDE) { if(this.m_iP == iLast) return this._setErr(XMLP.ERR_INFINITELOOP); iLast = this.m_iP; iRet = this._parseAttribute(this.m_iP, iDE); if(iRet == XMLP._ERROR) return iRet; } } strN = this.m_xml.substring(iB, iNE); if(strN.indexOf("<") != -1) { return this._setErr(XMLP.ERR_ELM_LT_NAME); } this.m_name = strN; this.m_iP = iE + 1; return iType; } XMLP.prototype._parseEntity = function(iB) { var iE = this.m_xml.indexOf(";", iB); if(iE == -1) { return this._setErr(XMLP.ERR_CLOSE_ENTITY); } this.m_iP = iE + 1; return this._replaceEntity(this.m_xml, iB, iE); } XMLP.prototype._parsePI = function(iB) { var iE, iTB, iTE, iCB, iCE; iE = this.m_xml.indexOf("?>", iB); if(iE== -1) { return this._setErr(XMLP.ERR_CLOSE_PI); } iTB = SAXStrings.indexOfNonWhitespace(this.m_xml, iB, iE); if(iTB == -1) { return this._setErr(XMLP.ERR_PI_TARGET); } iTE = SAXStrings.indexOfWhitespace(this.m_xml, iTB, iE); if(iTE== -1) { iTE = iE; } iCB = SAXStrings.indexOfNonWhitespace(this.m_xml, iTE, iE); if(iCB == -1) { iCB = iE; } iCE = SAXStrings.lastIndexOfNonWhitespace(this.m_xml, iCB, iE); if(iCE== -1) { iCE = iE - 1; } this.m_name = this.m_xml.substring(iTB, iTE); this._setContent(XMLP._CONT_XML, iCB, iCE + 1); this.m_iP = iE + 2; return XMLP._PI; } XMLP.prototype._parseText = function(iB) { var iE, iEE; iE = this.m_xml.indexOf("<", iB); if(iE == -1) { iE = this.m_xml.length; } iEE = this.m_xml.indexOf("&", iB); if((iEE != -1) && (iEE <= iE)) { iE = iEE; } this._setContent(XMLP._CONT_XML, iB, iE); this.m_iP = iE; return XMLP._TEXT; } XMLP.prototype._replaceEntities = function(strD, iB, iE) { if(SAXStrings.isEmpty(strD)) return ""; iB = iB || 0; iE = iE || strD.length; var iEB, iEE, strRet = ""; iEB = strD.indexOf("&", iB); iEE = iB; while((iEB > 0) && (iEB < iE)) { strRet += strD.substring(iEE, iEB); iEE = strD.indexOf(";", iEB) + 1; if((iEE == 0) || (iEE > iE)) { return this._setErr(XMLP.ERR_CLOSE_ENTITY); } iRet = this._replaceEntity(strD, iEB + 1, iEE - 1); if(iRet == XMLP._ERROR) { return iRet; } strRet += this.m_cAlt; iEB = strD.indexOf("&", iEE); } if(iEE != iE) { strRet += strD.substring(iEE, iE); } this._setContent(XMLP._CONT_ALT, strRet); return XMLP._ENTITY; } XMLP.prototype._replaceEntity = function(strD, iB, iE) { if(SAXStrings.isEmpty(strD)) return -1; iB = iB || 0; iE = iE || strD.length; switch(strD.substring(iB, iE)) { case "amp": strEnt = "&"; break; case "lt": strEnt = "<"; break; case "gt": strEnt = ">"; break; case "apos": strEnt = "'"; break; case "quot": strEnt = "\""; break; default: if(strD.charAt(iB) == "#") { strEnt = String.fromCharCode(parseInt(strD.substring(iB + 1, iE))); } else { return this._setErr(XMLP.ERR_ENTITY_UNKNOWN); } break; } this._setContent(XMLP._CONT_ALT, strEnt); return XMLP._ENTITY; } XMLP.prototype._setContent = function(iSrc) { var args = arguments; if(XMLP._CONT_XML == iSrc) { this.m_cAlt = null; this.m_cB = args[1]; this.m_cE = args[2]; } else { this.m_cAlt = args[1]; this.m_cB = 0; this.m_cE = args[1].length; } this.m_cSrc = iSrc; } XMLP.prototype._setErr = function(iErr) { var strErr = XMLP._errs[iErr]; this.m_cAlt = strErr; this.m_cB = 0; this.m_cE = strErr.length; this.m_cSrc = XMLP._CONT_ALT; return XMLP._ERROR; } SAXDriver = function() { this.m_hndDoc = null; this.m_hndErr = null; this.m_hndLex = null; } SAXDriver.DOC_B = 1; SAXDriver.DOC_E = 2; SAXDriver.ELM_B = 3; SAXDriver.ELM_E = 4; SAXDriver.CHARS = 5; SAXDriver.PI= 6; SAXDriver.CD_B= 7; SAXDriver.CD_E= 8; SAXDriver.CMNT= 9; SAXDriver.DTD_B = 10; SAXDriver.DTD_E = 11; SAXDriver.prototype.parse = function(strD) { var parser = new XMLP(strD); if(this.m_hndDoc && this.m_hndDoc.setDocumentLocator) { this.m_hndDoc.setDocumentLocator(this); } this.m_parser = parser; this.m_bErr = false; if(!this.m_bErr) { this._fireEvent(SAXDriver.DOC_B); } this._parseLoop(); if(!this.m_bErr) { this._fireEvent(SAXDriver.DOC_E); } this.m_xml = null; this.m_iP = 0; } SAXDriver.prototype.setDocumentHandler = function(hnd) { this.m_hndDoc = hnd; } SAXDriver.prototype.setErrorHandler = function(hnd) { this.m_hndErr = hnd; } SAXDriver.prototype.setLexicalHandler = function(hnd) { this.m_hndLex = hnd; } SAXDriver.prototype.getColumnNumber = function() { return this.m_parser.getColumnNumber(); } SAXDriver.prototype.getLineNumber = function() { return this.m_parser.getLineNumber(); } SAXDriver.prototype.getMessage = function() { return this.m_strErrMsg; } SAXDriver.prototype.getPublicId = function() { return null; } SAXDriver.prototype.getSystemId = function() { return null; } SAXDriver.prototype.getLength = function() { return this.m_parser.getAttributeCount(); } SAXDriver.prototype.getName = function(index) { return this.m_parser.getAttributeName(index); } SAXDriver.prototype.getValue = function(index) { return this.m_parser.getAttributeValue(index); } SAXDriver.prototype.getValueByName = function(name) { return this.m_parser.getAttributeValueByName(name); } SAXDriver.prototype._fireError = function(strMsg) { this.m_strErrMsg = strMsg; this.m_bErr = true; if(this.m_hndErr && this.m_hndErr.fatalError) { this.m_hndErr.fatalError(this); } } SAXDriver.prototype._fireEvent = function(iEvt) { var hnd, func, args = arguments, iLen = args.length - 1; if(this.m_bErr) return; if(SAXDriver.DOC_B == iEvt) { func = "startDocument"; hnd = this.m_hndDoc; } else if (SAXDriver.DOC_E == iEvt) { func = "endDocument"; hnd = this.m_hndDoc; } else if (SAXDriver.ELM_B == iEvt) { func = "startElement"; hnd = this.m_hndDoc; } else if (SAXDriver.ELM_E == iEvt) { func = "endElement"; hnd = this.m_hndDoc; } else if (SAXDriver.CHARS == iEvt) { func = "characters"; hnd = this.m_hndDoc; } else if (SAXDriver.PI== iEvt) { func = "processingInstruction"; hnd = this.m_hndDoc; } else if (SAXDriver.CD_B== iEvt) { func = "startCDATA"; hnd = this.m_hndLex; } else if (SAXDriver.CD_E== iEvt) { func = "endCDATA"; hnd = this.m_hndLex; } else if (SAXDriver.CMNT== iEvt) { func = "comment"; hnd = this.m_hndLex; } if(hnd && hnd[func]) { if(0 == iLen) { hnd[func](); } else if (1 == iLen) { hnd[func](args[1]); } else if (2 == iLen) { hnd[func](args[1], args[2]); } else if (3 == iLen) { hnd[func](args[1], args[2], args[3]); } } } SAXDriver.prototype._parseLoop = function(parser) { var iEvent, parser; parser = this.m_parser; while(!this.m_bErr) { iEvent = parser.next(); if(iEvent == XMLP._ELM_B) { this._fireEvent(SAXDriver.ELM_B, parser.getName(), this); } else if(iEvent == XMLP._ELM_E) { this._fireEvent(SAXDriver.ELM_E, parser.getName()); } else if(iEvent == XMLP._ELM_EMP) { this._fireEvent(SAXDriver.ELM_B, parser.getName(), this); this._fireEvent(SAXDriver.ELM_E, parser.getName()); } else if(iEvent == XMLP._TEXT) { this._fireEvent(SAXDriver.CHARS, parser.getContent(), parser.getContentBegin(), parser.getContentEnd() - parser.getContentBegin()); } else if(iEvent == XMLP._ENTITY) { this._fireEvent(SAXDriver.CHARS, parser.getContent(), parser.getContentBegin(), parser.getContentEnd() - parser.getContentBegin()); } else if(iEvent == XMLP._PI) { this._fireEvent(SAXDriver.PI, parser.getName(), parser.getContent().substring(parser.getContentBegin(), parser.getContentEnd())); } else if(iEvent == XMLP._CDATA) { this._fireEvent(SAXDriver.CD_B); this._fireEvent(SAXDriver.CHARS, parser.getContent(), parser.getContentBegin(), parser.getContentEnd() - parser.getContentBegin()); this._fireEvent(SAXDriver.CD_E); } else if(iEvent == XMLP._COMMENT) { this._fireEvent(SAXDriver.CMNT, parser.getContent(), parser.getContentBegin(), parser.getContentEnd() - parser.getContentBegin()); } else if(iEvent == XMLP._DTD) { } else if(iEvent == XMLP._ERROR) { this._fireError(parser.getContent()); } else if(iEvent == XMLP._NONE) { return; } } } SAXStrings = function() { } SAXStrings.WHITESPACE = " \t\n\r"; SAXStrings.QUOTES = "\"'"; SAXStrings.getColumnNumber = function(strD, iP) { if(SAXStrings.isEmpty(strD)) { return -1; } iP = iP || strD.length; var arrD = strD.substring(0, iP).split("\n"); var strLine = arrD[arrD.length - 1]; arrD.length--; var iLinePos = arrD.join("\n").length; return iP - iLinePos; } SAXStrings.getLineNumber = function(strD, iP) { if(SAXStrings.isEmpty(strD)) { return -1; } iP = iP || strD.length; return strD.substring(0, iP).split("\n").length } SAXStrings.indexOfNonWhitespace = function(strD, iB, iE) { if(SAXStrings.isEmpty(strD)) { return -1; } iB = iB || 0; iE = iE || strD.length; for(var i = iB; i < iE; i++){ if(SAXStrings.WHITESPACE.indexOf(strD.charAt(i)) == -1) { return i; } } return -1; } SAXStrings.indexOfWhitespace = function(strD, iB, iE) { if(SAXStrings.isEmpty(strD)) { return -1; } iB = iB || 0; iE = iE || strD.length; for(var i = iB; i < iE; i++) { if(SAXStrings.WHITESPACE.indexOf(strD.charAt(i)) != -1) { return i; } } return -1; } SAXStrings.isEmpty = function(strD) { return (strD == null) || (strD.length == 0); } SAXStrings.lastIndexOfNonWhitespace = function(strD, iB, iE) { if(SAXStrings.isEmpty(strD)) { return -1; } iB = iB || 0; iE = iE || strD.length; for(var i = iE - 1; i >= iB; i--){ if(SAXStrings.WHITESPACE.indexOf(strD.charAt(i)) == -1){ return i; } } return -1; } SAXStrings.replace = function(strD, iB, iE, strF, strR) { if(SAXStrings.isEmpty(strD)) { return ""; } iB = iB || 0; iE = iE || strD.length; return strD.substring(iB, iE).split(strF).join(strR); } Stack = function() { this.m_arr = new Array(); } Stack.prototype.clear = function() { this.m_arr = new Array(); } Stack.prototype.count = function() { return this.m_arr.length; } Stack.prototype.destroy = function() { this.m_arr = null; } Stack.prototype.peek = function() { if(this.m_arr.length == 0) { return null; } return this.m_arr[this.m_arr.length - 1]; } Stack.prototype.pop = function() { if(this.m_arr.length == 0) { return null; } var o = this.m_arr[this.m_arr.length - 1]; this.m_arr.length--; return o; } Stack.prototype.push = function(o) { this.m_arr[this.m_arr.length] = o; } function isEmpty(str) { return (str==null) || (str.length==0); } function trim(trimString, leftTrim, rightTrim) { if (isEmpty(trimString)) { return ""; } if (leftTrim == null) { leftTrim = true; } if (rightTrim == null) { rightTrim = true; } var left=0; var right=0; var i=0; var k=0; if (leftTrim == true) { while ((i=left) && (whitespace.indexOf(trimString.charAt(k--))!=-1)) { right++; } } return trimString.substring(left, trimString.length - right); } function __escapeString(str) { var escAmpRegEx = /&/g; var escLtRegEx = //g; var quotRegEx = /"/g; var aposRegEx = /'/g; str = str.replace(escAmpRegEx, "&"); str = str.replace(escLtRegEx, "<"); str = str.replace(escGtRegEx, ">"); str = str.replace(quotRegEx, """); str = str.replace(aposRegEx, "'"); return str; } function __unescapeString(str) { var escAmpRegEx = /&/g; var escLtRegEx = /</g; var escGtRegEx = />/g; var quotRegEx = /"/g; var aposRegEx = /'/g; str = str.replace(escAmpRegEx, "&"); str = str.replace(escLtRegEx, "<"); str = str.replace(escGtRegEx, ">"); str = str.replace(quotRegEx, "\""); str = str.replace(aposRegEx, "'"); return str; } function addClass(classCollectionStr, newClass) { if (classCollectionStr) { if (classCollectionStr.indexOf("|"+ newClass +"|") < 0) { classCollectionStr += newClass + "|"; } } else { classCollectionStr = "|"+ newClass + "|"; } return classCollectionStr; } DOMException = function(code) { this._class = addClass(this._class, "DOMException"); this.code = code; }; DOMException.INDEX_SIZE_ERR= 1; DOMException.DOMSTRING_SIZE_ERR= 2; DOMException.HIERARCHY_REQUEST_ERR= 3; DOMException.WRONG_DOCUMENT_ERR= 4; DOMException.INVALID_CHARACTER_ERR= 5; DOMException.NO_DATA_ALLOWED_ERR= 6; DOMException.NO_MODIFICATION_ALLOWED_ERR= 7; DOMException.NOT_FOUND_ERR = 8; DOMException.NOT_SUPPORTED_ERR= 9; DOMException.INUSE_ATTRIBUTE_ERR= 10; DOMException.INVALID_STATE_ERR= 11; DOMException.SYNTAX_ERR = 12; DOMException.INVALID_MODIFICATION_ERR= 13; DOMException.NAMESPACE_ERR = 14; DOMException.INVALID_ACCESS_ERR= 15; DOMImplementation = function() { this._class = addClass(this._class, "DOMImplementation"); this._p = null; this.preserveWhiteSpace = false; this.namespaceAware = true; this.errorChecking= true; }; DOMImplementation.prototype.escapeString = function DOMNode__escapeString(str) { return __escapeString(str); }; DOMImplementation.prototype.unescapeString = function DOMNode__unescapeString(str) { return __unescapeString(str); }; DOMImplementation.prototype.hasFeature = function DOMImplementation_hasFeature(feature, version) { var ret = false; if (feature.toLowerCase() == "xml") { ret = (!version || (version == "1.0") || (version == "2.0")); } else if (feature.toLowerCase() == "core") { ret = (!version || (version == "2.0")); } return ret; }; DOMImplementation.prototype.loadXML = function DOMImplementation_loadXML(xmlStr) { var parser; try { parser = new XMLP(xmlStr); } catch (e) { alert("Error Creating the SAX Parser. Did you include xmlsax.js or tinyxmlsax.js in your web page?\nThe SAX parser is needed to populate XML for